import PureLoginBox from '../components/login-box';
import * as UserAction from 'actions/user';
import * as ReactRedux from 'react-redux';

const mapStateToProps = (state) => {
  return {
    loginUser: state.loginUser
  };
};

const mapDispatchToProps = (dispatch) => {
  return {
    onLoginSubmit(params) {
      dispatch(UserAction.login(params));
    },
    onLogout() {
      dispatch(UserAction.logout());
    }
  };
};

export default ReactRedux.connect(mapStateToProps, mapDispatchToProps)(PureLoginBox);
